{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "dbed347c-181f-4178-ab67-915064a44985",
   "metadata": {},
   "source": [
    "\n",
    "- 基于 Momentum 的 SGD\n",
    "\n",
    "    $$\n",
    "    \\begin{split}\n",
    "    v_t&=\\beta v_{t-1}+g_t\\\\\n",
    "    \\theta_{t+1}&=\\theta_t-\\alpha v_t\n",
    "    \\end{split}\n",
    "    $$\n",
    "    \n",
    "\n",
    "    - 对于 $v_t$ 部分递归的结果：$v_t=\\sum_{i=0}^{t-i}\\beta^ig_{t-i}$ （$v_0$ 初始化为 0）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ee28e34f-3c8d-4815-a457-b65f203db2d2",
   "metadata": {},
   "source": [
    "- EMA (Exponential Moving Average)\n",
    "\n",
    "$$\n",
    "\\begin{split}\n",
    "\\text{EMA}_t&=\\alpha x_t+(1-\\alpha) \\text{EMA}_{t-1}\\\\\n",
    "&=\\alpha x_t+(1-\\alpha)\\alpha x_{t-1}+(1-\\alpha)^2\\alpha x_{t-2}+\\cdots+(1-\\alpha)^{t-1}\\alpha x_1\n",
    "\\end{split}\n",
    "$$"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
